
/**
 * 加载游戏资源
 *
 * @author li.youxi
 * @date 2017/05/25
 */
require('./index.scss');

var tpl = require('./index.html'),
	doc = document;

var mainObj = require('../main/rain/index.js');

var loadingObj = {
	init: function(){
		doc.querySelector('#game_loading').innerHTML = tpl;

		this.preloadImage();
	},

	//预加载图片
	preloadImage: function(){

		setTimeout(function(){
			gameObj.setStatus('main');
			mainObj.start();
		}, 3000);
	}
};

globalMessage.on('init.loading', function(){
	loadingObj.init();
});

module.exports = loadingObj;